﻿/********************************************************************************************************************
* Author:	Aristidis Mihail																						*
* Email:	std03055@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_user_get_categories_OwnerOf" that		*
*			returns the categories a user owns																		*
********************************************************************************************************************/

CREATE PROCEDURE [dbo].[usp_user_get_categories_ownerOf]
	@userid bigint

AS
	SELECT [categories].id,[Categories].Name									
	FROM [Categories]
	WHERE [Categories].Owner = @userid and Categories.IsDeleted = 0 
RETURN 0